package chapter1.classLoader;

/**
 * @Author juzipi
 * @Date 2021/5/11 10:49
 * @Info
 */
public class ClassLoaderTest {

    public static void main(String[] args) throws ClassNotFoundException {


        ClassLoader classLoader = Class.forName("java.lang.String").getClassLoader();
        System.out.println(classLoader);//null

        //AppClassLoader,系统类加载器
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        System.out.println(contextClassLoader);//jdk.internal.loader.ClassLoaders$AppClassLoader@2437c6dc

        //PlatformClassLoader,扩展类加载器
        ClassLoader parent = ClassLoader.getSystemClassLoader().getParent();
        System.out.println(parent);

    }

}
